package cn.tedu.store.entity;

import java.io.Serializable;
import java.util.Date;
/**
 * 实体类的基类，abstract就是用来被继承的
 */
abstract class BaseEntity implements Serializable {

	private static final long serialVersionUID = -5665821293714854819L;
	private String createdUser;
	private Date createdTime;
	private String modefiedUser;
	private Date modefiedTime;
	
	public String getCreatedUser() {
		return createdUser;
	}
	public void setCreatedUser(String createdUser) {
		this.createdUser = createdUser;
	}
	public Date getCreatedTime() {
		return createdTime;
	}
	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}
	public String getModefiedUser() {
		return modefiedUser;
	}
	public void setModefiedUser(String modefiedUser) {
		this.modefiedUser = modefiedUser;
	}
	public Date getModefiedTime() {
		return modefiedTime;
	}
	public void setModefiedTime(Date modefiedTime) {
		this.modefiedTime = modefiedTime;
	}
	@Override
	public String toString() {
		return "BaseEntity [createdUser=" + createdUser + ", createdTime=" + createdTime + ", modefiedUser="
				+ modefiedUser + ", modefiedTime=" + modefiedTime + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((createdTime == null) ? 0 : createdTime.hashCode());
		result = prime * result + ((createdUser == null) ? 0 : createdUser.hashCode());
		result = prime * result + ((modefiedTime == null) ? 0 : modefiedTime.hashCode());
		result = prime * result + ((modefiedUser == null) ? 0 : modefiedUser.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BaseEntity other = (BaseEntity) obj;
		if (createdTime == null) {
			if (other.createdTime != null)
				return false;
		} else if (!createdTime.equals(other.createdTime))
			return false;
		if (createdUser == null) {
			if (other.createdUser != null)
				return false;
		} else if (!createdUser.equals(other.createdUser))
			return false;
		if (modefiedTime == null) {
			if (other.modefiedTime != null)
				return false;
		} else if (!modefiedTime.equals(other.modefiedTime))
			return false;
		if (modefiedUser == null) {
			if (other.modefiedUser != null)
				return false;
		} else if (!modefiedUser.equals(other.modefiedUser))
			return false;
		return true;
	}
	

}
